{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf250
{\fonttbl\f0\fnil\fcharset0 Georgia;\f1\fnil\fcharset0 LucidaGrande;}
{\colortbl;\red255\green255\blue255;\red95\green19\blue18;\red38\green38\blue38;}
{\*\listtable{\list\listtemplateid1\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid1\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid1}
{\list\listtemplateid2\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid101\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid2}}
{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}{\listoverride\listid2\listoverridecount0\ls2}}
\deftab720
\pard\pardeftab720\li500\ri500\sa100\ql\qnatural

\f0\fs44 \cf2 Code Kata One - Supermarket Pricing\
\pard\pardeftab720\sa200\ql\qnatural

\f1\fs24 \cf3 This kata arose from some discussions we\'92ve been having at the DFW {\field{\*\fldinst{HYPERLINK "http://www.pragmaticprogrammer.com/cgi-local/pragprog?DallasPractitioners"}}{\fldrslt \cf2 \ul \ulc2 Practioners}} meetings. The problem domain is something seemingly simple: pricing goods at supermarkets.\
Some things in supermarkets have simple prices: this can of beans costs $0.65. Other things have more complex prices. For example:\
\pard\tx220\tx720\pardeftab720\li720\fi-720\ql\qnatural
\ls1\ilvl0\cf3 {\listtext	\'95	}three for a dollar (so what\'92s the price if I buy 4, or 5?)\
{\listtext	\'95	}$1.99/pound (so what does 4 ounces cost?)\
{\listtext	\'95	}buy two, get one free (so does the third item have a price?)\
\pard\pardeftab720\sa200\ql\qnatural
\cf3 This kata involves no coding. The exercise is to experiment with various models for representing money and prices that are flexible enough to deal with these (and other) pricing schemes, and at the same time are generally usable (at the checkout, for stock management, order entry, and so on). Spend time considering issues such as:\
\pard\tx220\tx720\pardeftab720\li720\fi-720\ql\qnatural
\ls2\ilvl0\cf3 {\listtext	\'95	}does fractional money exist?\
{\listtext	\'95	}when (if ever) does rounding take place?\
{\listtext	\'95	}how do you keep an audit trail of pricing decisions (and do you need to)?\
{\listtext	\'95	}are costs and prices the same class of thing?\
{\listtext	\'95	}if a shelf of 100 cans is priced using "buy two, get one free", how do you value the stock?\
\pard\pardeftab720\sa200\ql\qnatural
\cf3 This is an ideal shower-time kata, but be careful. Some of the problems are more subtle than they first appear. I suggest that it might take a couple of weeks worth of showers to exhaust the main alternatives.\
\pard\pardeftab720\sa200\ql\qnatural

\fs36 \cf3 Goal\
\pard\pardeftab720\sa200\ql\qnatural

\fs24 \cf3 The goal of this kata is to practice a looser style of experimental modelling. Look for as many different ways of handling the issues as possible. Consider the various tradeoffs of each. What techniques use best for exploring these models? For recording them? How can you validate a model is reasonable?\cf3 \
\
Copied from {\field{\*\fldinst{HYPERLINK "http://codekata.pragprog.com/2007/01/code_kata_one_s.html"}}{\fldrslt http://codekata.pragprog.com/2007/01/code_kata_one_s.html}}\
}